from celery_tasks.main import app
from django.core.mail import send_mail
from django.conf import settings


@app.task(name='send_verify_email')
def send_verify_email(to_email, verify_url):
    message = f'<p>尊敬的用户：</p><p>感谢使用商城</p><p>您的邮箱为{to_email[0]}。请点击以下链接以激活您的邮箱：</p> <p><a href={verify_url}>激活链接</a>'
    send_mail(subject="confirm email_celery", message=message, from_email=settings.EMAIL_HOST_USER, recipient_list=to_email)
    # send_mail(subject="confirm email", message='message', from_email='baifei0514@163.com', recipient_list=to_email)
